<template>
<div class="contain">
  <div class="page">
    <div class="driver-head mb30">
      <div class="displayflex driver-bottom">
        <div class="flex1" @click="dispatchEme">
          <p><span class="org">{{todolist.PendingJJOrderCount}}</span>单</p>
          <em>加急订单待派单</em>
        </div>
        <div class="flex1" @click="getlinkdispatch">
          <p><span class="blue">{{todolist.PendingOrderCount}}</span>单</p>
          <em>普通订单待派单</em>
        </div>
      </div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(1)">
      <div class="label">超时未接单</div>
      <div class="ctx flex1 txt-rit"><span class="org ft17">{{todolist.OvertimePendingOrderCount}}</span>单</div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(2)">
      <div class="label">30分钟仍未提货</div>
      <div class="ctx flex1 txt-rit"><span class="org ft17">{{todolist.Pick20OrderCount}}</span>单</div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(3)">
      <div class="label">需45分钟内送达</div>
      <div class="ctx flex1 txt-rit"><span class="org ft17">{{todolist.Distribution45OrderCount}}</span>单</div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(4)">
      <div class="label">需45分钟内签收</div>
      <div class="ctx flex1 txt-rit"><span class="org ft17">{{todolist.Sign45OrderCount}}</span>单</div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(5)">
      <div class="label">异常订单</div>
      <div class="ctx flex1 txt-rit"><span class="org ft17">{{todolist.AbnormalOrderCount}}</span>单</div>
    </div>
    <div class="form-box displayflex" @click="orderUrl(6)">
      <div class="label">已签收</div>
      <div class="ctx flex1 txt-rit"><span class="green ft17">{{todolist.OrderCount}}</span>单</div>
    </div>
  </div>
  <div class="exit mt-exit" @click="backlogin()">退出登录</div>
</div>
</template>

<script>
export default {
  data() {
    return {
      todolist:[],
    };
  },
  computed: {
    userinfo() {
      if (localStorage.UserInfo) {
        return JSON.parse(localStorage.UserInfo);
      }
    }
  },
  created() {
    this.getData();
    // this.getIndexData();
  },
  methods: {
    dispatchEme(){
      this.$router.push({
        path:'/dispatchEme'
      })
    },
    getlinkdispatch(){
      this.$router.push({
        path:'/dispatch'
      })
    },
    getData(){
      var query = {
      },
      _this = this;
      _this.Ajax.post('OperateIndexInfo',query).then(function(resp){
        if(resp.IsSuccess){
          _this.todolist = resp.Data;
        }
      });
    },
    orderUrl(type){
       this.$router.push({
        path:'/pallList',
        query:{type:type}
      })
    },
    backlogin(){
      sessionStorage.clear();
      localStorage.clear();
        this.$router.push({
        path:'/login',
      })
    }
  }
};
</script>